package com.seven.demoprometheusspringboot.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author seven
 * @Date 2021/3/23 17:46
 * @Description
 * @Version 1.0
 */
@RestController
@RequestMapping("/")
public class Demo {

    @GetMapping("hello")
    public String getOne() {
        return "你好~";
    }

    @GetMapping("error")
    public Integer error() {
        return 1 / 0;
    }

    @GetMapping("json")
    public Map json() {
        return Map.of("key1", "value1", "key2", "value2");
    }
}
